package com.atguigu.service.impl;

import com.atguigu.dao.AdminDao;
import com.atguigu.dao.BaseDao;
import com.atguigu.dao.HouseBrokerDao;
import com.atguigu.entity.Admin;
import com.atguigu.entity.HouseBroker;
import com.atguigu.entity.HouseImage;
import com.atguigu.service.HouseBrokerService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class HouseBrokerServiceImpl extends BaseServiceImpl<HouseBroker> implements HouseBrokerService {
    @Autowired
    private HouseBrokerDao houseBrokerDao;
    @Autowired
    private AdminDao adminDao;
    @Override
    public List<HouseBroker> getByHouseId(Long id) {
        return houseBrokerDao.getByHouseId(id);
    }

    @Override
    public List<Admin> findHouseOtherBroker(Long houseId) {

        List<Long> houseBrokerId = houseBrokerDao.getBrokerIdByHouseId(houseId);

        return adminDao.findHouseOtherBroker(houseBrokerId);
    }


    @Override
    public BaseDao<HouseBroker> getBaseDao() {
        return houseBrokerDao;
    }
}
